<?php
/**
 * 项目执行方案操作类
 *
 */
class MeijieExeClass extends FrameWork {
	
	public static $table = "media_execution";
	/**
	 * 信息列表 
	 * @author workflow Develop Team     
	 * @param  $condition,$obj_page
	 * @return array
	 */
	function list_meijie($condition,&$obj_page){
		$company_array = $GLOBALS['db']->GetList($condition, $obj_page, self::$table);
		return $company_array;
	}
	
	/**
	 * 信息添加 
	 * @author workflow Develop Team     
	 * @param  $value_array
	 * @return bool
	 */
	function add_meijie($value_array){
		if (is_array($value_array)){
			$valueArray = array();
			foreach ($value_array as $k => $v){
				if ($v != ''){
					$valueArray[$k] = $v;
				}
			}
			$result = $GLOBALS['db']->InsertRow($valueArray,self::$table,"id");
			unset($value_array,$valueArray);
			return $result;
		}
		return false;
	}
	
	/**
	 * 取信息
	 * @author workflow Develop Team     
	 * @param  $id
	 * @return array
	 */
	function get_meijie_by_id($id){
		if (intval($id) > 0){
			$value_array = $GLOBALS['db']->GetOneRow(intval($id),self::$table,'id');
			return $value_array;
		}
		return false;
	}
	
	
	/**
	 * 修改信息
	 * @author workflow Develop Team     
	 * @param  $value_array
	 * @return bool
	 */
	function update_meijie($value_array){
		if (is_array($value_array) && intval($value_array['id']) > 0){
			$valueArray = array();
			foreach ($value_array as $k => $v){
				$valueArray[$k] = $v;
			}
			$result = $GLOBALS['db']->UpdateRow(intval($valueArray['id']), $valueArray, self::$table, 'id');
			unset($value_array,$valueArray);
			return $result;
		}
		return false;
	}
	
	/**
	 * 删除信息
	 * @author workflow Develop Team     
	 * @param  $id
	 * @return bool
	 */
	function del_meijie($id){
		if (intval($id) > 0){
			$result = $GLOBALS['db']->DeleOneRow(intval($id),self::$table,'id');
			return $result;
		}
		return false;
	}
}
?>